<template>
	<div class="container">
		<div class="chj_answer">
			<div class="chj_crumbs">
				<span>当前位置  : </span>
				<a href="https://www.qiyebang.net.cn/" style="color: #575757"> 网站首页> </a>
				<span>疑问解答</span>
			</div>
			<div id="chj_ans_content">
				<div class="chj_ans_left">
					<div class="chj_left_m1">
						<div class="chj_left_m1_conetent">
							<div style="min-height: 234px;">
								<div class="chj_le_issify af">
									<p class="iss_tit">问题分类</p>
									<div class="iss_cont">
										<p>选择问题类型有助于我们更快的解答您的疑问</p>
										<ul style="margin-top: 16px;" class="af">
											<a href="javascript:;">
												<li v-for="(i,index) in xuan" :key='index' v-bind:class="[index==m_tap ? 'chj_tap':'issibe_tap']" @click="c_wenlei(index)">
													{{i?i.title:''}}
												</li>
											</a>
										</ul>
									</div>
								</div>
								<div class="af c_biaoti" style="padding-bottom: 16px;">
										<p class="iss_tit">问题标题</p>
										<div class="iss_cont">
											<input class="conipt" type="text" v-model="chj_biaoti" placeholder="在这里输入问题，马上为你解答" value=""/>
										</div>
								</div>
								<div class="chj_le_issify af">
									<p class="iss_tit">问题描述</p>
									<div class="iss_cont">
										<!--textarea-->
										<textarea v-model="chj_value" class="ms_con" style="min-width:668px;height:66px;resize: none;padding-top: 15px;padding-left: 14px;font-size: 14px;" placeholder="再这里输入问题，马上为你解答"></textarea>
										<ul class="chj_le_detail" style="padding-bottom: 24px;">
											<li class="chj_my_on">为了更准确的理解您的问题，请您尽可能详细描述您的问题。</li>
											<li @click="submits" class="chj_my_quiz" style="cursor: pointer;">我要提问</li>
										</ul>
									</div>
								</div>
							</div>
							<div style="min-height: 136px;">
								<div class="chj_le_list_filst">
									<div class="chj_le_list" v-for="(i,index) in this.title.newzui.data" :key="index">
										<div class="chj_le_list_left">
											<span class="chj_le_da">答</span>
											<span class="chj_le_us" style="color: #575757;margin-left: 16px;margin-right: 10px;">{{i.name}}</span>
											<span class="chj_le_huida" style="color: #909090;margin-right: 10px;">回答了</span>
											<span class="chj_le_wt"><a class="chj_list_a" :href="'/questionDetails/'+i.id">{{i.title}}</a></span>
										</div>
										<div class="chj_le_list_right">
											<span>{{i.updatetime}}</span>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="chj_left_m1 chj_top">
						<div class="chj_module">
							<div class="chj_module_tit">
								<span>已解决问题</span>
								<div class="chj_my_quiz">
									<a href="/questionList?is_solve=1">更多</a>
								</div>
							</div>
								
							<div class="chj_le_list chj_module_list" v-for="(i,index) in wen" :key="index">
								<div class="chj_le_list_left">
									<span><a :href="'/questionDetails/'+i.id" class="chj_list_a" >{{i.title}}</a></span>
									<span>[{{i.cate_title}}]</span>
								</div>
								<div class="chj_le_list_right">
									<span>回答数 ： {{i.answer_number}}</span>
									<span style="margin-left: 15px; margin-right: 20px; "><i class="icon"></i></span>
									<span>{{i.updatetime}}</span>
								</div>
							</div>
						</div>
					</div>
					<div class="chj_left_m1 chj_top">
						<div class="chj_module">
							<div class="chj_module_tit">
								<span>待解决问题</span>
								<div class="chj_my_quiz">
									<a href="/questionList?is_solve=0">更多</a>
								</div>
							</div>
							
							<div class="chj_le_list chj_module_list" v-for="(i,index) in wei" :key="index">
							
								<div class="chj_le_list_left">
									<span><a :href="'/questionDetails/'+i.id" class="chj_list_a" >{{i.title}}</a></span>
									<span>[{{i.cate_title}}] </span>
								</div>
								<div class="chj_le_list_right">
									<span>回答数 ： {{i.answer_number}}</span>
									<span style="margin-left: 15px; margin-right: 20px; "><i class="icon"></i></span>
									<span>{{i.updatetime}}</span>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="chj_ans_right">
					<div class="chj_r_imghade chj_write_img"><img src="~/assets/img/chj_answer1.gif" alt=""></div>
					<div class="chj_r_imgcont chj_write_img"><img src="~/assets/img/chj_answer2.gif" alt=""></div>
					<div class="chj_left_m1 chj_top">
						<div class="chj_r_value_list">
							<div class="chj_r_list_tit">积分值排行榜</div>
							<ul class="chj_r_list_contentlist af" v-for="(i,index) in jifen" :key="index">
								<li class="chj_contentlist_le">
									<span v-bind:class="[index<3 ? 'bj bj'+index : 'chj_items']">{{index>2?index+1:''}}</span>
									<em style="margin-left:47px">{{i.username}}</em>
								</li>
								<li class="chj_contentlist_ri">
									<em>积分值 ：<i style="color:#0055e6;font-style:normal;font-size:14px;font-weight:400;"> {{i.score}}</i> </em>
								</li>
							</ul>
						</div>
					</div>
					<div class="chj_left_m1 chj_top">
						<div class="chj_r_value_list">
							<div class="chj_r_list_tit">热门回答</div>
							<ul style="padding: 12px 18px;border-top: 1px dotted #ccc;" v-for="(i,index) in this.title.aa.data" :key="index" v-if="index<6">
								<li>
									
									<a style="color: #212529;display: block;width: 100%;height: 100%;" target="_blank" :href="'/questionDetails/'+i.id">
										<span style="width: 7px;height: 7px;background: #0056e7;display: inline-block;margin-right: 10px;"></span><span>{{i.content}}</span></a>
								</li>
								<li style="margin-left: 22px;font-size: 12px; color:#999999">
									<span>回答数 ：{{i.answer_number}}</span>
								</li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		<my-ft></my-ft>
	</div>

</template>

<script>
	import axios from 'axios';
	import $ from 'jquery';
	export default {
		name: 'HelloWorld',
		data() {
			return {
				xuan: '',
				chj_value: '',
				m_tap: 0,
				chj_biaoti:'',
				wen:'',
				wei:'',
				jifen:'',
//				a:0,
			}
		},
		
		async asyncData({
			params
		}) {
			//https://exam.zhonghaiqihang.com/PInterface/ProblemCate分类列表
			//https://exam.zhonghaiqihang.com/PInterface/Problem所有问题
			let nh = await axios.get(`https://exam.zhonghaiqihang.com/PInterface/Header/headerData`);
			let nh2 = await axios.get(`https://exam.zhonghaiqihang.com/PInterface/ProblemCate`);
			let newzui = await axios.get(`https://exam.zhonghaiqihang.com/PInterface/Problem/newest`);
			let ss = await axios.get(`https://exam.zhonghaiqihang.com/PInterface/Problem`,{
      params:{
       is_solve:1,
      }});
      			let ww = await axios.get(`https://exam.zhonghaiqihang.com/PInterface/Problem`,{
      params:{
       is_solve:0,
      }});
      let aa = await axios.get(`https://exam.zhonghaiqihang.com/PInterface/Problem`,{
      params:{
        hot:1,
      }});
      let jifen = await axios.get(`https://exam.zhonghaiqihang.com/PInterface/problem/scoreList`);
			let data = {
				nav: nh.data,
				a:nh2.data,
				newzui:newzui.data,
				ss:ss.data,
				ww:ww.data,
				aa:aa.data,
				jifen:jifen.data
			};
			return {
				title: data
			}
		},

		mounted: function() {
			this.wen = this.title.ss.data
			this.wei = this.title.ww.data
			this.jifen = this.title.jifen.data
			console.log(this.title)
			this.xuan = this.title.a.data
		},
  head () {
    return {
      title: '在线问答_财税问答_工商热点问答_企业邦',
      meta: [
        { hid: 'description', name: 'description', content: '企业邦热线:400-855-1888,企业经营资质服务平台,加急注册公司,注册地址变更,注销,商标注册,公司转让,代理记账,公司收购,资质代办,建筑施工资质,总承包资质,专业承包资质,劳务资质,代办执照,食品经营许可证,广播电视节目许可,知识产权代理,税收筹划等专业的全方位企业服务。' },
        { hid: 'keywords', name: 'keywords', content: '注册地址变更,注销,商标注册,公司转让,代理记账,公司收购,资质代办,建筑施工资质,总承包资质,专业承包资质,劳务资质,代办执照,食品经营许可证,广播电视节目许可,知识产权代理,税收筹划' }
      ]
  }
  },

		methods: {
			c_wenlei(uid){
				
				this.m_tap=uid
				console.log(uid+1)
			},
			submits(){
				console.log(this.m_tap)
				if(this.chj_value == ''){
					alert('请输入内容')
				}else if(this.chj_biaoti == ''){
					alert('请输入标题')
				}else{
					var a = this.m_tap+1
					console.log(a)
					console.log('成功')
					this.$axios.post('api/PInterface/Problem/add','cate_id='+a+'&title='+this.chj_biaoti+'&content='+this.chj_value).then(function(res){
						console.log(res)
						alert('提问成功')
					})
      
					
				}
				 
//				console.log(typeof this.chj_value)
					
//						console.log(typeof this.chj_biaoti)
			}
		}
	}
</script>

<style scoped>

</style>